cmake_minimum_required(VERSION 3.28)
project(we C CXX)
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" FORCE)
#set(NO_YACC_PROCESS 1)

if (WITH_FOLLY)
    #让folly dep dir固定下来与版本无关
    execute_process(COMMAND gsed "s/return \"%s-%s\" % (manifest.name, project_hash)/return manifest.name/" -i ${CMAKE_CURRENT_LIST_DIR}/thirdparty/src/folly/build/fbcode_builder/getdeps/load.py)
    #执行下面这句安装folly dep
    #python3 ./build/fbcode_builder/getdeps.py --allow-system-packages --scratch-path ~/.cache/fdep/ build

    set(fdep_dir ~/.cache/fdep/installed)
    set(CMAKE_PREFIX_PATH
            ${fdep_dir}/libdwarf;
            ${fdep_dir}/googletest;
            ${fdep_dir}/glog;
            ${fdep_dir}/gflags;
            ${fdep_dir}/fmt;
            ${fdep_dir}/boost;
    )
    set(BOOST_LINK_STATIC ON)
    set(BUILD_TESTS ON)
    set(BUILD_BENCHMARKS OFF)

    add_subdirectory(thirdparty/src/folly)
    include_directories(thirdparty/src/folly)
endif ()

add_subdirectory(src/css)
add_subdirectory(src/cli)